// pages/school/school.js
const API = require("../../http/API")
const http = require("../../http/http")
Page({
    /**
     * 页面的初始数据
     */
    data: {
        submenuList:[
            {
                imgUrl:'https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h1-b_2211.png',
                text:'全部课程'
            },
            {
                imgUrl:'https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h2-o_2211.png',
                text:'直播班'
            },
            {
                imgUrl:'https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h3-p_2211.png',
                text:'特训班'
            },
            {
                imgUrl:'https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h4-g_2211.png',
                text:'入门班'
            },
            {
                imgUrl:'https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h5-p_2211.png',
                text:'学习问答'
            },
            {
                imgUrl:'https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h6-r_2211.png',
                text:'学院作业'
            },
            {
                imgUrl:'https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h7-y_2211.png',
                text:'怎样学习'
            },
            {
                imgUrl:'https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h8-c_2211.png',
                text:'关于我们'
            },
        ],
        workImg:[
            {
                imgUrl:'https://ss.lanqb.com/o_1dggr8oho1d3q17fe67pmhg1kgq7.jpg?imageView2/1/w/330/h/420',
                text:'一个月学习成果'
            },
            {
                imgUrl:'https://ss.lanqb.com/o_1dj6n767e1nst59m1c7166c1e294m.jpg?imageView2/1/w/330/h/420',
                text:'一个月学习成果'
            },
            {
                imgUrl:'https://ss.lanqb.com/o_1dh0ed8hrdg71obbl4t1ld51bi62s.jpg?imageView2/1/w/330/h/420',
                text:'一个月学习成果'
            },
            {
                imgUrl:'https://ss.lanqb.com/o_1dh0m79m41gb01vhnn7l138115u6c.jpg?imageView2/1/w/330/h/420',
                text:'一个月学习成果'
            },
            {
                imgUrl:'https://ss.lanqb.com/o_1e0fgovju10a910vc1bem111t1nkps.jpg?imageView2/1/w/330/h/420',
                text:'一个月学习成果'
            },
            {
                imgUrl:'https://ss.lanqb.com/o_1f90ccu18fr01fqvp67145g193d44.jpg?imageView2/1/w/330/h/420',
                text:'一个月学习成果'
            },
        ],
        limit:4,
        teacher_show:1,
        // professionals数据
        professionals:[],
        swiperItem:[],
        swiperItemText:[
            // {
            //     text:"热门推荐"
            // },
            {
                text:"坚持画画，领高额奖学金"
            },
            
            {
                text:"30天学会用ipad画插画"
            },
            {
                text:"日系插画，怎么上手"
            },
            {
                text:"重磅！日系插画直播教学"
            }
        ],
        teacher:[]

    },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        http(API. professionals,{
            limit:this.data.limit,
            teacher_show:this.data.teacher_show,
        }).then(res=>{
            this.setData({
                
                professionals:res.data.data
            })
            // console.log(res.data.data);
        }),
        // 校网轮播图
        http('https://m.lanqb.com/api/home/banner?type=m&local_code=20&limit=6&order=weight',{
            // https://ss.lanqb.com/o_1gj8nv4882f61fh1q1k3q913281v.png?imageView2/1/w/344/h/477
            // https://ss.lanqb.com/o_1gq8ad9eb3bv1gom1npt1n531dekc.zip
        }).then(res=>{
          this.setData({
            swiperItem:res.data.data
          })
        })
        http('https://m.lanqb.com/api/school/teacher?limit=3',{}).then(res=>{
            console.log(res.data.data);
            this.setData({
                teacher: res.data.data.course
            })
        })
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {

    }
})